package textFile;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

// 使用Writer写入文本文件
public class WriterTest {
    public static void main(String[] args) {
        try(Writer writer = new FileWriter("D:/work/test.txt")) {
            writer.write("你好，ABCD");
            writer.flush();
        } catch (IOException e) {
            e.printStackTrace();
        } ;
    }
}
